$(function(){
	ShowTabl();
});
function BalanceSel(){
	ShowTabl();
}

function ShowTabl(){
	//获取用户姓名
	var user = document.getElementById("userid").value;
	user=encodeURI(encodeURI(user));
	//获取审批状态
	var shop = document.getElementById("shopid").value;
	//alert(shop);
	shop = encodeURI(encodeURI(shop));
	var url = "balance/all.do?account="+user+"&shopname="+shop;
	
	var tableSource = new $.jqx.dataAdapter({
		dataType: "json",
		dataFields:[
		    { name: "id",type:"int"},
		    { name: "account",type:"string"},
		    { name: "username", type: "string" },
		    { name: "payid", type: "string" },
		    { name: "shopname", type: "string" },
		    { name: "pointpay", type: "float" },
		    { name: "walletpay", type: "float" },
		    { name: "paytime",type:"date"}
		],
		id: "id",	
		url:url
	});
	ShowTableData(tableSource);
	
}
function ShowTableData(tableSource){
	$("#dataTable").jqxDataTable({
		width: "100%",
        source: tableSource,
        pageable: true,
        pageSize: 20,
        serverProcessing: true,
        pagerButtonsCount: 10,
        columnsResize: true,
        sortable: true,
        columns: [
            { text: "序号", width: 50, cellsRenderer: function(row) { return (row + 1).toString(); } },
            { text: "用户账号",dataField:"account"},
            { text: "用户名",dataField:"username"},
            { text:	"支付id",dataField:"payid"},
            { text: "商店名",dataField:"shopname"},
            { text: "使用余额",dataField:"pointpay"},
            { text: "使用积分",dataField:"walletpay"},
            { text: "交易时间",dataField:"paytime",
            	cellsRenderer: function(row, column, value, rowData) {
            		return format(value, "Y-M-D H:I");
            	}}
        ],
	});
}



